<%@page import="entities.Email"%>
<%@page import="java.util.TreeMap"%>
<%
TreeMap<String, String> check = (TreeMap<String, String>) request.getAttribute("check");
String success = (String) request.getAttribute("success");
Email email = (Email) request.getAttribute("email");
String form = (String) request.getAttribute("form");
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/layouts/header.jsp" />
	
	<h3><span><%=form.equalsIgnoreCase("add") ? "Add Site" : "Edit Site" %></span></h2>
	
	<% if (success != null) {%>
	<div class="notification msgsuccess">
        <a class="close"></a>
        <p><%=success %></p>
    </div>
	<% } %>
	
	<form method="post" class="form-horizontal">
		<div class="control-group <%=check.get("email") != null ? "error" : ""%>">
		    <label class="control-label" for="inputEmail">Email Address</label>
		    <div class="controls">
		    	<input name="emailAddress" type="text" id="inputEmail" placeholder="Enter email" value="<%=email.getEmail() != null ? email.getEmail() : "" %>">
		      	<% if (check.get("email") != null) { %>
		      	<span class="help-inline"><%=check.get("email") %></span>
		      	<% } %>
		    </div>
		</div>
		
		
		<div class="control-group <%=check.get("status") != null ? "error" : ""%>">
		    <label class="control-label" for="inputStatus">Status</label>
		    <div class="controls">
		    	<select name="status">
		    		<option value="0" <%=email.getStatus()== 0 ? "selected=\"selected\"" : "" %>>Inactive</option>
		    		<option value="1" <%=email.getStatus()== 1 ? "selected=\"selected\"" : "" %>>Active</option>
		    	</select>
		      	<% if (check.get("status") != null) { %>
		      	<span class="help-inline"><%=check.get("status") %></span>
		      	<% } %>
		    </div>
		</div>
		
		<div class="control-group">
		    <div class="controls">
		      	<button type="submit" class="btn">Submit</button>
		    </div>
		</div>
		
	</form>
	
<jsp:include page="/layouts/footer.jsp" />